package pt.nmfa.peste.session;

import pt.nmfa.peste.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("feedMoviesList")
public class FeedMoviesList extends EntityQuery<FeedMovies> {

	private static final String EJBQL = "select feedMovies from FeedMovies feedMovies";

	private static final String[] RESTRICTIONS = {
			"lower(feedMovies.movieName) like lower(concat(#{feedMoviesList.feedMovies.movieName},'%'))",
			"lower(feedMovies.movieImdbUrl) like lower(concat(#{feedMoviesList.feedMovies.movieImdbUrl},'%'))", };

	private FeedMovies feedMovies = new FeedMovies();

	public FeedMoviesList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public FeedMovies getFeedMovies() {
		return feedMovies;
	}
}
